Fix issue with Username being required for Shared server import config#9971
Open
KijongHan wants to merge 2 commits into
Open
Fix issue with Username being required for Shared server import config#9971KijongHan wants to merge 2 commits into
KijongHan wants to merge 2 commits into
Conversation
validate_json_data required Username for all non-Service connections, rejecting legitimate JSON that only carried SharedUsername. Accept either attribute when Shared is true; keep Username required for non-shared servers. Extract is_shared as a local while we're here — it's now referenced twice in the loop body. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d servers When loading database servers from an import file, fall back to SharedUsername for the underlying server.username when the server is shared and no explicit Username is provided. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
WalkthroughChanges to server import validation and loading logic in ChangesShared Server Configuration and Validation
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #9226
What does this PR do?
This PR resolves
Username attribute not found for server 'shared_server'errors where server json import validation logic had a hard constraint onUsernamebeing required even whenSharedwas set to true. This PR introduces more coherent constraint validation logic for shared servers so that you are required to either provideSharedUsernameorUsername(for backwards compatibility). Furthermore, the underlying data model 'Username' property is set to 'SharedUsername' (for shared servers only) to align with UI behaviour for setting this fallback.The UX also feels better as when after registering shared servers with only the
SharedUsernameset, when trying to connect to the server for the first time it prompts for the password (instead of showing an infinite loading spinner because the underlyingUsernameis not set)Summary of changes
add separate
Usernameconstraint validation logic for shared servers when importingservers.jsonadd fallback to set
UsernametoSharedUsernamefor shared servers so that the UX flow matches the manual UI creation flow for registering new shared serversSummary by CodeRabbit